package com.qf.service.impl;

import com.qf.dao.GoodsDao;
import com.qf.pojo.Goods;
import com.qf.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("goodsService")
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private GoodsDao goodsDao;

    @Override
    public List<Goods> selectAll() {
        return goodsDao.selectAll();
    }

    @Override
    public List<Goods> selectOne(String mess) {
        mess="%"+mess+"%";
        return goodsDao.selectOne(mess);
    }

    @Override
    public List<Goods> selectByType(String mess) {
        return goodsDao.selectByType(mess);
    }

    @Override
    public int update(Goods goods) {
        return goodsDao.update(goods);
    }

    @Override
    public int delete(int id) {
        return goodsDao.delete(id);
    }

    @Override
    public int deleteAll(List<Integer> id) {
        return goodsDao.deleteAll(id);
    }

    @Override
    public int add(Goods goods) {
        return goodsDao.add(goods);
    }
}
